using UnityEngine;
using System.Collections;

public static class PhysxHelper
{
    #region Motion Methods

    public static Vector3 GetUniformRectilinearMotion(Vector3 direction, float speed)
    {
        return direction * speed * Time.deltaTime;
    }

    public static Vector3 GetUniformAccelerationRectilinearMotion(Vector3 direction, ref float speed, float acceleration)
    {
        speed += acceleration * Time.deltaTime;
        Vector3 accelerationVector = Vector3.one * acceleration / 2 * Time.deltaTime * Time.deltaTime;

        return direction * speed * Time.deltaTime + accelerationVector;
    }

    public static Vector3 GetDirectionForLinearFollow(Vector3 position, Vector3 positionToFollow)
    {
        Vector3 direction = positionToFollow - position;
        direction.Normalize();
        return direction;
    }

    #endregion
}
